package com.thrd.taiexhibition.base;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;

import com.thrd.taiexhibition.R;
import com.thrd.taiexhibition.bean.BackActivity;

import org.jetbrains.annotations.Nullable;

/**
 * @author: ${唐杰}
 * @date: 2021/3/23
 */
public abstract class BackTitleActivity extends BackActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        View view=View.inflate(this, R.layout.activity_title,null);
        setContentView(view);
        FrameLayout mFrameLayout =view.findViewById(R.id.fl_layout);
        View viewContent=View.inflate(this, getLayout(),null);
        mFrameLayout.addView(viewContent,FrameLayout.LayoutParams.MATCH_PARENT,FrameLayout.LayoutParams.MATCH_PARENT);
        view.findViewById(R.id.fl_back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        initView();
        initData();
        initEvent();
    }

    protected abstract int getLayout();

    protected abstract void initView() ;

    protected abstract void initData();

    protected abstract void initEvent();

}
